package com.sky.controller.admin;

import com.sky.dto.SetmealDTO;
import com.sky.result.Result;
import com.sky.service.SetmealService;
import com.sky.vo.SetmealVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "套餐管理")
@Slf4j
@RestController
@RequestMapping("/admin/setmeal")

public class SetmealController
{
    @Autowired
    private SetmealService setmealService;

    @ApiOperation("新增套餐")
    @PostMapping
    public Result insert(SetmealDTO setmealDTO) {
        log.info("套餐分类 = " + setmealDTO);
/*        setmealService.insert(setmealDTO);*/

        return Result.success();
    }

    /**
     * 根据ID查询套餐
     *
     * @param id
     * @return
     */
    @ApiOperation("根据ID查询套餐")
    @GetMapping("/{id}")
    public Result<SetmealVO> selectById(@PathVariable Integer id) {

        SetmealVO setmealVO = setmealService.selectById(id);
        return null;
    }

}
